from likeshop_api_project.api.login_api import login_model
from likeshop_api_project.base.mybase import Tools


# 获取商品收藏列表
class get_collection_products_model(Tools):
    path = '/api/collect/getCollectGoods'

    def get_collection_products_action(self, hd):
        get_collection_products = self.huihua.get(url=self.hosturl+self.path, headers=hd)
        return get_collection_products.json()



if __name__ == '__main__':
    import requests

    s = requests.session()
    reg = login_model(huihua=s)
    msg = reg.login_action(account="13356786546", password="rr98765", client=2)
    # print(msg)
    get_token = msg["data"]["token"]
    # print(get_token)
    get_userid = str(msg["data"]["id"])
    print(get_userid)
    hd = {"id": get_userid, "token": get_token}
    print(hd)

    get_collection_products = get_collection_products_model(huihua=s)

    msg = get_collection_products.get_collection_products_action(hd=hd)
    print(msg)
